package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BieVillageMapper;
import com.ruoyi.system.domain.BieVillage;
import com.ruoyi.system.service.IBieVillageService;

/**
 * 住宅小区Service业务层处理
 * 
 * @author zxl
 * @date 2021-05-03
 */
@Service
public class BieVillageServiceImpl implements IBieVillageService 
{
    @Autowired
    private BieVillageMapper bieVillageMapper;

    /**
     * 查询住宅小区
     * 
     * @param villageId 住宅小区ID
     * @return 住宅小区
     */
    @Override
    public BieVillage selectBieVillageById(String villageId)
    {
        return bieVillageMapper.selectBieVillageById(villageId);
    }

    /**
     * 查询住宅小区列表
     * 
     * @param bieVillage 住宅小区
     * @return 住宅小区
     */
    @Override
    public List<BieVillage> selectBieVillageList(BieVillage bieVillage)
    {
        return bieVillageMapper.selectBieVillageList(bieVillage);
    }

    /**
     * 新增住宅小区
     * 
     * @param bieVillage 住宅小区
     * @return 结果
     */
    @Override
    public int insertBieVillage(BieVillage bieVillage)
    {
        bieVillage.setCreateTime(DateUtils.getNowDate());
        bieVillage.setVillageId(UUID.randomUUID().toString());
        return bieVillageMapper.insertBieVillage(bieVillage);
    }

    /**
     * 修改住宅小区
     * 
     * @param bieVillage 住宅小区
     * @return 结果
     */
    @Override
    public int updateBieVillage(BieVillage bieVillage)
    {
        return bieVillageMapper.updateBieVillage(bieVillage);
    }

    /**
     * 批量删除住宅小区
     * 
     * @param villageIds 需要删除的住宅小区ID
     * @return 结果
     */
    @Override
    public int deleteBieVillageByIds(String[] villageIds)
    {
        return bieVillageMapper.deleteBieVillageByIds(villageIds);
    }

    /**
     * 删除住宅小区信息
     * 
     * @param villageId 住宅小区ID
     * @return 结果
     */
    @Override
    public int deleteBieVillageById(String villageId)
    {
        return bieVillageMapper.deleteBieVillageById(villageId);
    }
}
